<#import "/common/base.ftl" as base/>
<#import "/common/button.ftl" as but/>
<#import "/common/tableOpt.ftl" as tabt/>
<#import "/common/widget.ftl" as widget/>
<#assign jses=[
"/js/service/settings.js",
"/js/app/settings.js"] in base/>
<#assign csses=["/webjars/1.0.0/css/colors.css","/css/settings.css"] in base/>
<@base.page "">
    <!-- -->
    <div class="grid-content bg-purple-light">
        <el-col :span="24" class="content-wrapper">
            <section>
                <el-col :span="24" class="toolbar">
                    <el-row><label>基础信息</label></el-row>
                    <el-col>
                        <el-form :model="editVm.data" label-width="150px" :rules="editVm.editFormRules.formRules"
                                 ref="editForm">
                            <el-row>
                                <el-form-item label="机器码" prop="deviceId">
                                    <el-input v-model="settings.deviceId" :disabled="true" maxlength="20" placeholder="请输入机器码"
                                              clearable></el-input>
                                </el-form-item>
                                <el-form-item label="智件名称" prop="deviceName">
                                    <el-input v-model="editVm.data.deviceName" maxlength="20" placeholder="自定义名称"
                                              clearable></el-input>
                                </el-form-item>
                                <el-form-item label="商户ID(配合数据场)" prop="serverId">
                                    <el-input v-model="editVm.data.serverId" maxlength="20" placeholder="商户ID"
                                              clearable></el-input>
                                </el-form-item>
                                <el-form-item label="上传logo" prop="logo">
                                    <el-upload
                                            class="avatar-uploader"
                                            action="<@spring.url '/api/settings/uploadImage' />"
                                            :show-file-list="false"
                                            :on-success="handleAvatarSuccess"
                                            :on-remove="handleRemove"
                                            :before-upload="beforeAvatarUpload">
                                        <img v-if="iconUrl" :src="iconUrl" class="avatar">
                                        <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                                    </el-upload>
                                </el-form-item>
                                <el-form-item label="备注" prop="remark">
                                    <el-input
                                            type="textarea"
                                            placeholder="此处输入备注"
                                            v-model="editVm.data.remark"
                                            maxlength="30"
                                            show-word-limit
                                    ></el-input>
                                </el-form-item>
                                <el-form-item>
                                    <@tabt.save "mSave(editVm)" />
                                </el-form-item>
                            </el-row>
                        </el-form>
                    </el-col>
                </el-col>
            </section>
        </el-col>
    </div>
</@base.page>
